package com.program.cloudmanagesystem.login.persistence;
import com.program.cloudmanagesystem.login.domain.State;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository

public interface StateMapper {
    @Select("SELECT * from state ")
    List<State> shouwStates();
    @Select("SELECT * from state where state.object = #{id}")
    State searchState(String id);
    @Insert("insert into state(object,parkingrate,checkrate,capacityrate) VALUES (#{object},#{parkingrate},#{checkrate},#{capacityrate})")
    void addState(@Param("object") String object,@Param("parkingrate") String parkingrate,@Param("checkrate") String checkrate,@Param("capacityrate") String capacityrate);
    @Update("update state set parkingrate = #{parkingrate},`checkrate` = #{checkrate},capacityrate = #{capacityrate} where state.object = #{id}")
    void updateNow(@Param("object") String object,@Param("parkingrate") String parkingrate,@Param("checkrate") String checkrate,@Param("capacityrate") String capacityrate);
}
